<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns="http://www.w3.org/1999/xhtml" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:math="http://www.w3.org/1998/Math/MathML">

	<xsl:include href="common.xsl"/>

	<xsl:output method="xml"/>

	<xsl:template match="formalAssertions">
		<!--the path is relative to the output file directory-->
		<xsl:processing-instruction name="xml-stylesheet" select="('type=&quot;text/xsl&quot;','href=&quot;../xsl/presentation/style/mathml.xsl&quot;')"/>
		<html>
			<head>
				<title></title>
				<style type="text/css">body {font-size: 130%} p.nondegeneracyCondition { color: rgb(160,160,160); }</style>
			</head>
			<body>
				<xsl:apply-templates/>
			</body>
		</html>
	</xsl:template>

	<xsl:template match="formalRepresentation">
		<!--the path is relative to the output file directory-->

		<center><h2>
			<xsl:value-of select="@type"/><xsl:number count="formalRepresentation" level="single" format="1. "/><xsl:value-of select="@name"/></h2></center>
		<hr size="3" color="#333333"/>
		<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="assumption">
		<h3>Hypothesis</h3>
		<p>
			<xsl:for-each select="./*">
				<xsl:apply-templates select="."/>
				<xsl:choose>
					<xsl:when test="not(name()='declare') and not(name()='constraint') and not(name()='nondegeneracyCondition') and not(name()='configuration')">
						<xsl:text>; </xsl:text>
					</xsl:when>
				</xsl:choose>
			</xsl:for-each>
		</p>
		<hr/>
	</xsl:template>


	<xsl:template match="objective">
		<h3>Conclusion</h3>
		<p>
			<xsl:for-each select="./*">
				<xsl:apply-templates select="."/>
				<xsl:choose>
					<xsl:when test="not(name()='declare') and not(name()='constraint') and not(name()='nondegeneracyCondition') and not(name()='configuration')">
						<xsl:text>;</xsl:text>
					</xsl:when>
				</xsl:choose>
			</xsl:for-each>
		</p>
	</xsl:template>

	<xsl:template match="declare">
		<xsl:if test="./*">
			<div>
				<xsl:text>Declare: </xsl:text>
				<xsl:for-each select="./*[not(position()=last())]">
					<xsl:apply-templates select="."/>
					<xsl:text>, </xsl:text>
				</xsl:for-each>
				<xsl:apply-templates select="./*[position()=last()]"/>
				<xsl:text>; </xsl:text>
			</div>
		</xsl:if>
	</xsl:template>

	<xsl:template match="give">
			<xsl:text>given </xsl:text>	
			<xsl:for-each select="./*[not(position()=last())]">
				<xsl:apply-templates select="."/>
				<xsl:text>,</xsl:text>
			</xsl:for-each>
			<xsl:apply-templates select="./*[position()=last()]"/>
	</xsl:template>

	

	<xsl:template match="constraint">
		<xsl:if test="./*/*">
			<br/>
			<b>
				<xsl:text> Where </xsl:text>
			</b>
			<xsl:apply-templates/>
		</xsl:if>
	</xsl:template>

	<xsl:template match="and">
		<xsl:for-each select="./*[not(position()=last())]">
			<xsl:apply-templates select="."/>
			<br/>&#x2227;</xsl:for-each>
		<xsl:apply-templates select="./*[position()=last()]"/>
	</xsl:template>

	<xsl:template match="or">
		<xsl:text>(</xsl:text>
		<xsl:for-each select="./*[not(position()=last())]">
			<xsl:apply-templates select="."/>
			<br/>&#x2228;</xsl:for-each>
		<xsl:apply-templates select="./*[position()=last()]"/>
		<xsl:text>)</xsl:text>
	</xsl:template>


	<xsl:template match="nondegeneracyCondition">
		<!--xsl:if test="./*/*">
			<p class="nondegeneracyCondition">
				<b>NondegeneracyCondition:</b>
				<br/>
				<xsl:apply-templates select="./*"/>
			</p>
		</xsl:if-->
	</xsl:template>

		

</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2007. Progress Software Corporation. 保留所有权力.
<metaInformation>
<scenarios/><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->